<?php
drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
drupal_add_css(path_to_theme() . '/css/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));

/**
 * Preprocessor for page.tpl.php template file.
 */

function truyenngan_preprocess_page(&$vars, $hook) {
	
	$main_menu = menu_tree('main-menu');   
    $vars['main_menu_links'] = drupal_render($main_menu);	
}

function shortenText($text, $number_char, $bacham=1, $bohtml=1)
{

    if($bohtml==1)
        $text= strip_tags($text);		// bo wa tat ca the html
    $text=trim($text);

    $l=strlen($text);

    $text= $text." ";	// dieu kien dung tranh chuoi rong
    $text = substr($text, 0, $number_char);	// tach lay num ky tu
    $text=substr($text, 0, strrpos($text, " "));	// lui ve den khi gap khoang trang
    if($bacham==1 and $l>$number_char )
        $text .= "...";
    return $text;
}

